<?php
// +----------------------------------------------------------------------
// | 后台用户管理
// +----------------------------------------------------------------------
namespace app\common\model;
use think\Model;

class GoodsMeal extends Model
{
	//商品，一对一关联
	public function goods(){
        return $this->hasOne('goods','id','goods_id')->bind([
        	'goods_name'=>'name',
        	'goods_img'=>'img',
        ]);
    }
    
    //商品规格，一对一关联
	public function specs(){
        return $this->hasOne('goodsSpecs','id','specs_id')->bind([
        	'specs_name'=>'name',
        	'specs_img'=>'img',
        	'price'=>'price',
        	'sale_price'=>'sale_price',
        ]);
    }
}
